<template>
  <el-dialog
    width="30%"
    title="修改入住套餐价格"
    :visible.sync="innerVisible"
    append-to-body
    destroy-on-close

  >

    <el-form ref="list"    :model="list"    label="top">
      <el-form-item label="套餐名称" prop="name">

        <span>
            {{list.name}}
        </span>

      </el-form-item>

      <el-form-item label="套餐日费用" prop="dailyFee" >
        <el-input v-model="list.dailyFee"    ></el-input>


      </el-form-item>

      <el-form-item label="套餐月费用"  prop="monthFee" >
        <el-input v-model="list.monthFee"   ></el-input>

      </el-form-item>



    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="innerVisible = false">取 消</el-button>
      <el-button type="primary" @click="save">保存</el-button>
    </div>
  </el-dialog>
</template>

<script>
    import { searchtcinfo } from "@/api/moveset"
    import { resvise } from "@/api/revisejg"
    export default {
        name: "revisejg",
        data(){
            return{

                innerVisible:false,
                list:
                    {   dailyFee:'',
                        monthFee:"",
                        checkInMark:"",
                        name:"",
                    },
                rules:{
                    name: [{ required: true, trigger: "blur", message: "套餐名称" ,type:'string'}],
                    dailyFee:[{ required: true, message: "日费用", trigger: "blur",type:'number'}],
                    monthFee:[{ required: true, message: "月费用",trigger: "blur",type:'number'}],


                },
                options: [

                ],
            }
        },
        mounted(){

        },
        methods:{
            showEdit(row) {
                this.tcinfo=[]
                console.log(row)
                let checkInMark=row.checkInMark
                searchtcinfo({checkInMark}).then(res => {
                    console.log(res.data)
                    this.list.checkInMark=res.data.checkInMark
                    this.list.monthFee=res.data.monthFee
                    this.list.dailyFee=res.data.dailyFee
                    this.list.name=res.data.name
                    console.log(this.list)


                })
                console.log(row)
                console.log(row.checkInMark)
                this.innerVisible = true;
            },
          save(){

              resvise(this.list).then(res => {
                  console.log(res)
                  if(res.code==200){
                      this.$message({
                          message: "修改成功",
                          type: 'success'
                      })
                  }else {

                  }

              })

          },
        }

    }
</script>

<style scoped>

</style>
